package com.ft.springboottravel.util;

import java.util.List;

import org.springframework.stereotype.Component;
/**
 * <b> ��ҳͨ���� </b>
 * @param <T>
 *
 */
@Component
public class Pager<T> {

	private List<T> list;  //����
	private int pageSize;  //ÿҳ����
	private int currentPage;  //��ǰҳ
	private long total;  //������
	private long totalPage; //��ҳ��
	private long begin;
	private long end;
	
	
	
	public long getBegin() {
		return begin;
	}
	public void setBegin(long begin) {
		this.begin = begin;
	}
	public long getEnd() {
		return end;
	}
	public void setEnd(long end) {
		this.end = end;
	}
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public long getTotal() {
		return total;
	}
	public void setTotal(long total) {
		this.total = total;
		// ��ҳ��
		this.totalPage = this.total % this.pageSize > 0 ? this.total / this.pageSize + 1
		 				: this.total / this.pageSize;
	}
	public long getTotalPage() {
		return totalPage;
	}
	@Override
	public String toString() {
		return "Pager [list=" + list + ", pageSize=" + pageSize + ", currentPage=" + currentPage + ", total=" + total
				+ ", totalPage=" + totalPage + ", begin=" + begin + ", end=" + end + "]";
	}
	
	
	
	
}
